package com.yoshino.mediator;

/**
 * 具体的同事类
 * @author yoshino
 **/
public class CoffeeMachine extends Colleague{
    public CoffeeMachine(Mediator mediator, String name) {
        super(mediator, name);
        //在创建Alarm同事对象时，将自己放入到ConcreteMediator对象中[集合]
        mediator.Register(name, this);
    }

    @Override
    public void SendMessage(int stateChange) {
        this.GetMediator().GetMessage(stateChange, this.name);
    }

    public void StartCoffee() {
        System.out.println("开咖啡机");
    }

    public void FinishCoffee() {
        System.out.println("完成咖啡");
        SendMessage(0);
    }
}
